package com.hunliji.monitor.web.controller.app;

import com.hunliji.common.response.ResponseData;
import com.hunliji.monitor.web.facade.GitLabWebhookFacade;
import com.hunliji.monitor.web.model.param.AlertChatBindParam;
import com.hunliji.monitor.web.model.param.GitLabNoteHookParam;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * File：GitLabWebhookController.java<br> Title: <br> Description: <br>
 *
 * @author lejin Date: 2023/7/25
 */
@RestController
@RequestMapping(value = "/appApi/gitLabWebhook")
@Slf4j
public class GitLabWebhookController {

    @Resource
    GitLabWebhookFacade gitLabWebhookFacade;

    /**
     * gitLabNoteHook
     * @param param
     * @return
     */
    @PostMapping(value = "/gitLabNoteHook", headers = "X-Gitlab-Event=Note Hook")
    public ResponseData<Boolean> gitLabNoteHook(@RequestBody GitLabNoteHookParam param) {
        return ResponseData.success(gitLabWebhookFacade.gitLabNoteHook(param));
    }
}
